package com.example.yoga.entity;

import java.math.BigDecimal;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableField;
import com.fasterxml.jackson.annotation.JsonFormat;

import java.io.Serializable;
import java.util.Date;

/**
 * <p>
 *
 * </p>
 *
 * @author liwenkai
 * @since 2021-03-10
 */
@TableName("card")
public class Card extends Model<Card> {

    private static final long serialVersionUID = 1L;

    /**
     * 瑜伽卡Id
     */
    @TableId(value = "cardId", type = IdType.AUTO)
    private Integer cardid;

    /**
     * 瑜伽卡号
     */
    @TableField("cardNo")
    private String cardno;

    /**
     * 账号余额
     */
    @TableField("balance")
    private BigDecimal balance;

    /**
     * 套餐开始日期
     */
    @JsonFormat(pattern="yyyy-MM-dd HH:mm:ss",timezone ="GMT+8")
    @TableField("begin_date")
    private Date beginDate;

    /**
     * 套餐结束日期
     */
    @JsonFormat(pattern="yyyy-MM-dd HH:mm:ss",timezone ="GMT+8")
    @TableField("end_date")
    private Date endDate;


    public Integer getCardid() {
        return cardid;
    }

    public void setCardid(Integer cardid) {
        this.cardid = cardid;
    }

    public String getCardno() {
        return cardno;
    }

    public void setCardno(String cardno) {
        this.cardno = cardno;
    }

    public BigDecimal getBalance() {
        return balance;
    }

    public void setBalance(BigDecimal balance) {
        this.balance = balance;
    }

    public Date getBeginDate() {
        return beginDate;
    }

    public void setBeginDate(Date beginDate) {
        this.beginDate = beginDate;
    }

    public Date getEndDate() {
        return endDate;
    }

    public void setEndDate(Date endDate) {
        this.endDate = endDate;
    }

    @Override
    protected Serializable pkVal() {
        return this.cardid;
    }

    @Override
    public String toString() {
        return "Card{" +
        "cardid=" + cardid +
        ", cardno=" + cardno +
        ", balance=" + balance +
        ", beginDate=" + beginDate +
        ", endDate=" + endDate +
        "}";
    }
}
